import java.io.File;
import java.util.ArrayList;
import java.util.List;

import easyaccept.EasyAcceptFacade;

/**
 * 
 * Test class. This class executes all the necessary tests calling a EasyAccept
 * instance.
 * 
 * @author Alexandre, Cristovao, Raul, Rodolpho e Tales
 * @version 1.0
 * 
 */
public class Tests {

	public static void main(String[] args) {
		
		// Deleta o arquivo 'convites.log'
		File file = new File("convites.log");
		if (file.exists() && file.isFile()) {
			file.delete();
		}
		
		// Deleta o arquivo 'emails.log'
		File file2 = new File("emails.log");
		if (file2.exists() && file2.isFile()) {
			file2.delete();
		}
		
		// Deleta o arquivo 'sms.log'
		File file3 = new File("sms.log");
		if (file3.exists() && file3.isFile()) {
			file3.delete();
		}
		
		// Deleta o arquivo 'beltrana-fulano.log'
		File file4 = new File("beltrana-fulano.log");
		if (file4.exists() && file4.isFile()) {
			file4.delete();
		}

		List<String> files = new ArrayList<String>();
		files.add("testes_aceitacao\\us1.txt");
		files.add("testes_aceitacao\\us2.txt");
		files.add("testes_aceitacao\\us3.txt");
		files.add("testes_aceitacao\\us4.txt");
		files.add("testes_aceitacao\\us5.txt");
		files.add("testes_aceitacao\\us6.txt");
		files.add("testes_aceitacao\\us7_1.txt");
		files.add("testes_aceitacao\\us7_2.txt");
		files.add("testes_aceitacao\\us7_3.txt");

		// Facade class instance to mediate the test
		USFacade testUS = new USFacade();

		EasyAcceptFacade eaFacade = new EasyAcceptFacade(testUS, files);
		eaFacade.executeTests();

		// Show results in the console
		System.out.println(eaFacade.getCompleteResults());
		System.out.println("Total Number of Tests: "
				+ eaFacade.getTotalNumberOfTests());
		System.out.println("Total Passed Tests: "
				+ eaFacade.getTotalNumberOfPassedTests());
		System.out.println("Total Failed Tests: "
				+ eaFacade.getTotalNumberOfNotPassedTests());

		
	}

}